from ultralytics import YOLO
import os

# # 删除可能损坏的模型文件
# if os.path.exists("yolo11n.pt"):
#     os.remove("yolo11n.pt")
#     print("已删除损坏的模型文件")

# 重新下载模型文件
model = YOLO("yolo11n.pt")

# Train the model on synthetic UAV dataset for 100 epochs
train_results = model.train(
    data="synthetic_data.yaml",  # Path to dataset configuration file
    epochs=2,  # Number of training epochs
    imgsz=640,  # Image size for training
    device="cpu",  # Device to run on (e.g., 'cpu', 0, [0,1,2,3])
)